#include "process.h"


char style[S_NUM]={'*','.','#','-','+'};

void ProcessOn()// 函数的定义
{
  char bar[NUM];
  int cnt = 0;
  const char* ptr="|\\-/";
  memset(bar,'\0',sizeof(bar));
 
  // 101 times
  while(cnt<=100)
  {
   // printf("[%-100s][%d%%][%c]\r",bar,cnt,ptr[cnt%4]);
    printf("\033[42;34m[%-100s][%d%%][%c]\033[0m\r",bar,cnt,ptr[cnt%4]);
    fflush(stdout);
    bar[cnt++] = style[N];
    usleep(50000);  //5秒/100=0.05秒=50000微秒
  }
  printf("\n");
}
